/**
 * 原型模式
 */
//  用原型实例指定创建对象的种类，并且通过拷贝这些原型创建新的对象

class MilkTea1 {
    type: string = '';
    ice: boolean = false;
    clone() {
        const milkTea = new MilkTea1();
        milkTea.type = this.type;
        milkTea.ice = this.ice;
        return milkTea;
    }
}

const milkTeaOfJay = new MilkTea1();
milkTeaOfJay.type = '原味';
milkTeaOfJay.ice = false;
const youMilkTea = milkTeaOfJay.clone();
// 一千位粉丝都调用 milkTeaOfJay 的 clone 方法即可
